<template>
  <div class="login">
    <van-form @submit="handleLogin" class="login-form">
      <van-cell-group inset style="margin:40% 60px auto">
        <van-field
          v-model="username"
          name="用户名"
          label="用户名"
          placeholder="用户名"
          :rules="[{ required: true, message: '请填写用户名' }]"
        />
        <van-field
          v-model="password"
          type="password"
          name="密码"
          label="密码"
          placeholder="密码"
          :rules="[{ required: true, message: '请填写密码' }]"
        />
      </van-cell-group>
      <div style="margin: 16px;">
        <van-button round block native-type="submit">
          提交
        </van-button>
      </div>
    </van-form>
    <!--  底部  -->
    <div class="el-login-footer">
      <span>Copyright © 2018-2022 ruoyi.vip All Rights Reserved.</span>
    </div>
  </div>
</template>
<script>

export default {
  name: 'HelloWorld',
  data () {
    return {
      username: 'test',
      password: 'test'
    }
  },
  methods: {
    handleLogin () {
      this.$router.push('/Home')
    }
  }
}
</script>

<style>
.login {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  background-image: url("../assets/login-homepage.jpg");
  background-size: cover;
}
.title {
  margin: 0 auto 40px auto;
  text-align: center;
  color: #707070;
}

.login-form {
  border-radius: 6px;
  background: #ffffff;
  width: 100%;
  height: 100%;
  padding: 25px 25px 5px 25px;
}
.el-login-footer {
  height: 40px;
  line-height: 40px;
  position: fixed;
  bottom: 0;
  width: 100%;
  text-align: center;
  color: black;
  font-size: 12px;
  letter-spacing: 1px;
}
</style>
